﻿using System;
using System.Collections.Generic;

using System.Text;
using Efficient.Domain;

namespace Efficient.DataAccess
{
    public interface IEntityQueryBuilder
    {
        /// <summary>
        /// 创建keyword的搜索条件
        /// </summary>
        /// <typeparam name="T">实体类</typeparam>
        /// <returns></returns>
        KeywordQuery BuildKeywordPart<T>();
        /// <summary>
        /// 创建keyword的搜索条件
        /// </summary>
        /// <typeparam name="T">实体类</typeparam>
        /// <param name="prix">字段前缀</param>
        /// <returns></returns>
        KeywordQuery BuildKeywordPart<T>(string prix);
        /// <summary>
        /// 创建keyword的搜索条件
        /// </summary>
        /// <param name="clazz">实体类类型</param>
        /// <returns></returns>
        KeywordQuery BuildKeywordPart(Type clazz);
        /// <summary>
        /// 创建keyword的搜索条件
        /// </summary>
        /// <param name="clazz">实体类类型</param>
        /// <param name="prix">字段前缀</param>
        /// <returns></returns>
        KeywordQuery BuildKeywordPart(Type clazz, string prix);

        /// <summary>
        /// 创建keyword的单表查询语句
        /// </summary>
        /// <typeparam name="T">实体类</typeparam>
        /// <param name="orderBy">排序信息</param>
        /// <returns></returns>
        KeywordQuery BuildQueryByKeyword<T>(params OrderField[] orderBy);

        /// <summary>
        /// 创建keyword的单表查询语句
        /// </summary>
        /// <typeparam name="T">实体类</typeparam>
        /// <param name="prix">字段前缀</param>
        /// <param name="orderBy">排序信息</param>
        /// <returns></returns>
        KeywordQuery BuildQueryByKeyword<T>(string prix, params OrderField[] orderBy);

        /// <summary>
        /// 创建keyword的单表查询语句
        /// </summary>
        /// <param name="clazz">实体类类型</param>
        /// <param name="orderBy">排序信息</param>
        /// <returns></returns>
        KeywordQuery BuildQueryByKeyword(Type clazz, params OrderField[] orderBy);

        /// <summary>
        /// 创建keyword的单表查询语句
        /// </summary>
        /// <param name="clazz">实体类类型</param>
        /// <param name="prix">字段前缀</param>
        /// <param name="orderBy">排序信息</param>
        /// <returns></returns>
        KeywordQuery BuildQueryByKeyword(Type clazz, string prix, params OrderField[] orderBy);
        /// <summary>
        /// 创建单表查询语句
        /// </summary>
        /// <param name="clazz">实体类</param>
        /// <param name="orderBy">排序信息</param>
        /// <returns></returns>
        string BuildQueryAll(Type clazz, params OrderField[] orderBy);
        /// <summary>
        /// 创建单表查询语句
        /// </summary>
        /// <param name="clazz">实体类</param>
        /// <param name="prix">字段前缀</param>
        /// <param name="orderBy">排序信息</param>
        /// <returns></returns>
        string BuildQueryAll(Type clazz, string prix, params OrderField[] orderBy);
        /// <summary>
        /// 创建单表查询语句
        /// </summary>
        /// <typeparam name="T">实体类</typeparam>
        /// <param name="orderBy">排序信息</param>
        /// <returns></returns>
        string BuildQueryAll<T>(params OrderField[] orderBy);
        /// <summary>
        /// 创建单表查询语句
        /// </summary>
        /// <typeparam name="T">实体类</typeparam>
        /// <param name="prix">字段前缀</param>
        /// <param name="orderBy">排序信息</param>
        /// <returns></returns>
        string BuildQueryAll<T>(string prix, params OrderField[] orderBy);

        
    }
}
